<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html>

<head>
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="robots" content="all,follow">

    <title>Shop Manager</title>
    <link rel="shortcut icon" href="img/favicon.ico" th:href="@{/model1/img/favicon.ico}">

    <!-- global stylesheets -->
    <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
    <link rel="stylesheet" href="css/bootstrap.min.css" th:href="@{/model1/css/bootstrap.min.css}">
    <link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css" th:href="@{/model1/font-awesome-4.7.0/css/font-awesome.min.css}">
    <link rel="stylesheet" href="css/font-icon-style.css" th:href="@{/model1/css/font-icon-style.css}">
    <link rel="stylesheet" href="css/style.default.css" th:href="@{/model1/css/style.default.css}" id="theme-stylesheet">

    <!-- Core stylesheets -->
    <link rel="stylesheet" href="css/form.css"  th:href="@{/model1/css/form.css}">
</head>

<body> 

<!--====================================================
                         MAIN NAVBAR
======================================================-->
    <header th:replace="model1/common/bar::topbar"></header>

<!--====================================================
                        PAGE CONTENT
======================================================-->
    <div class="page-content d-flex align-items-stretch">

        <!--***** SIDE NAVBAR *****-->
        <nav th:replace="model1/common/bar::sidebar(activeUri='product_mng')"></nav>

        <div class="content-inner chart-cont">

            <!--***** CONTENT *****-->     
            <div class="row">

                <!--***** FORM INPUTS *****-->
                <div class="col-md-12">
                    <form id="form1" name="form1" th:action="@{/admin/product/add.do}" th:method="post" enctype="multipart/form-data">
                    <div class="card form">
                    <div class="card-header">
                        <h3>添加商品</h3>
                    </div>
                    <br>
                    <div class="row">
                        <div class="col-md-6 " style="margin-left: auto;margin-right: auto">
                            <div class="form-group row">
                                <label for="name" style="width: 85px;" class=" col-form-label">商品名称</label>
                                <div class="col-9">
                                    <input class="form-control" type="text"  id="name" name="name">
                                    <div style="color: #FF0000" id="pname_tip"></div>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label for="price" style="width: 85px;" class=" col-form-label">商品价格</label>
                                <div class="col-9">
                                    <input class="form-control" type="text"  id="price" name="price">
                                    <div style="color: #FF0000" id="price_tip"></div>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label for="count" style="width: 85px;" class=" col-form-label">库存数量</label>
                                <div class="col-9">
                                    <input class="form-control" type="text"  id="count" name="count">
                                    <div style="color: #FF0000" id="count_tip"></div>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label for="description" style="width: 85px;" class=" col-form-label">商品描述</label>
                                <div class="col-9">
                                    <textarea rows="3" cols="30"   class="form-control" id="description" name="description"></textarea>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label for="image_1" style="width: 85px;" class=" col-form-label">商品图片1</label>
                                <div class="col-9">
                                    <input type="file" class="form-control-file" id="image_1" name="image_1">
                                    <div style="color: #FF0000" id="pimage_pic_tip"></div>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label for="image_2" style="width: 85px;" class=" col-form-label">商品图片2</label>
                                <div class="col-9">
                                    <input type="file" class="form-control-file" id="image_2" name="image_2">
                                    <div style="color: #FF0000" id="pimage_pic2_tip"></div>
                                </div>
                            </div>
                            <div class="form-group row">
                                <div class="col-9">
                                    <button type="button" class="btn btn-success" onclick="validateAndSubmit()">完成</button>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
                    </form>
                </div>
            </div> 

        </div>
    </div>

    <!--Global Javascript -->
    <script src="js/jquery.min.js" th:src="@{/model1/js/jquery.min.js}"></script>
    <script src="js/popper/popper.min.js" th:src="@{/model1/js/popper/popper.min.js}"></script>
    <script src="js/tether.min.js" th:src="@{/model1/js/tether.min.js}"></script>
    <script src="js/bootstrap.min.js" th:src="@{/model1/js/bootstrap.min.js}"></script>
    <script src="js/jquery.cookie.js" th:src="@{/model1/js/jquery.cookie.js}"></script>
    <script src="js/jquery.validate.min.js" th:src="@{/model1/js/jquery.validate.min.js}"></script>
    <script src="js/chart.min.js" th:src="@{/model1/js/chart.min.js}"></script>
    <script src="js/front.js" th:src="@{/model1/js/front.js}"></script>

    <!--Core Javascript -->
    <!--<script src="js/mychart.js" th:src="@{/model1/js/mychart.js}"></script>-->
    <script src="" th:src="@{/model1/js/product/product_add.js}"></script>
    <script src="" th:src="@{/model1/js/common.js}"></script>
</body>

</html>